/*
 * @Author: Dweriout 2428458948@qq.com
 * @Date: 2022-05-25 09:38:05
 * @LastEditors: Dweriout 2428458948@qq.com
 * @LastEditTime: 2022-06-18 14:43:47
 * @FilePath: \nien-vue3-admin\src\api\system\notice.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

// 查询公告列表
export const listNotice = (params) => request({
  url: '/system/notice/list',
  method: 'get',
  params,
})

// 查询公告详细
export const getNotice = (noticeId) => request({
  url: `/system/notice/${ noticeId }`,
  method: 'get',
})

// 新增公告
export const addNotice = (data) => request({
  url: '/system/notice/add',
  method: 'post',
  data,
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
})

// 修改公告
export const updateNotice = (data) => request({
  url: '/system/notice/edit',
  method: 'put',
  data,
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
})

// 删除公告
export const delNotice = (noticeId) => request({
  url: `/system/notice/${ noticeId }`,
  method: 'delete',
})

// 删除公告
export const delFile = ({ id, uid }) => request({
  url: '/system/notice/delFile',
  method: 'delete',
  params: {
    id,
    uid,
  },
})

// 员工下拉框
export const listUserTabDropDownBox = (params) => request({
  url: '/system/user/listTable',
  method: 'get',
  params,
})